package com.tanhua.admin;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.tanhua.admin.mapper.UserMapper;
import com.tanhua.admin.pojo.User;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import java.util.Date;

/**
 * @Author: JinboYang
 * @Description:
 * @Date: Created in 下午 17:35 2021/1/18
 * @ModifiedBy:
 */
@SpringBootTest
@RunWith(SpringJUnit4ClassRunner.class)
public class test {
    @Autowired
    private UserMapper userMapper;
    @Test
    public void me(){
        LambdaQueryWrapper<User> queryWrapper = new LambdaQueryWrapper<>();
        LambdaQueryWrapper<User> thisYearQueryWrapper = queryWrapper.between(User::getCreated, new Date(1578741633295L), new Date(1579346433295L));
        Integer thisYearCount = this.userMapper.selectCount(thisYearQueryWrapper);
        System.out.println("thisYearCount = " + thisYearCount);
    }

    public static void main(String[] args) {
        System.out.println(new Date(1579346433295L));
    }
}
